package com.lanou.authcenter.controller;

import com.lanou.authcenter.service.IUserService;
import com.lanou.k12.entity.ResultObject;
import com.lanou.k12.entity.User;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import javax.servlet.http.HttpSession;

@RestController
public class UserController {

    @Autowired
    IUserService service;

    @RequestMapping(value = "/login", method = {RequestMethod.POST})
    public ResultObject login(User u) {
        return  service.login(u);
    }

    @RequestMapping(value = "/logout", method = {RequestMethod.POST})
    public ResultObject logout() {
        return service.logout();
    }
}
